module two {
	export class ShareOpenPage extends BaseComponent {
		public constructor() {
			super("ShareOpenPage");
		}

		public jeInfo:two.JewelryInfo;
		public btn_go:eui.Button;
		public btn_buy:eui.Button;	
		public btn_back:eui.Button;


		protected created(): void {
			super.created();

			two.addTap(this.btn_go, ()=> {
				two.changePage("login");
			})

			two.addTap(this.btn_back, () => {
				two.showJewPage(this.starId);
			})

			two.addTap(this.btn_buy, () => {
				openPlatUrl();
			})
		}

		private starId:string;
		public resetStarId(starId:string, isOpen:boolean = true) {
			this.starId = starId;

			this.jeInfo.resetStarId(starId);

			this.btn_go.visible = isOpen;
			this.btn_buy.visible = isOpen;

			this.btn_back.visible = !isOpen;
		}
	}

	two.setClassMap("share_open", "two.ShareOpenPage");
}